<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改学生信息')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-product-edit" th:object="${product}">
        <input name="productId" th:field="*{productId}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label">品牌名称：</label>
            <select name="poBrandId" >
                <option th:each="brand : ${brandList}" th:value="${brand.brandId}" th:text="${brand.brandName}" th:selected="${brand.brandId}==${product.poBrandId}"></option>
            </select>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">商品类型：</label>
            <select name="poTypeId">
                <option th:each="type : ${typeList}" th:value="${type.typeId}" th:text="${type.typeName}" th:selected="${type.typeId}==${product.poTypeId}"></option>
            </select>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">商品型号：</label>
            <div class="col-sm-8">
                <input name="productModel" th:field="*{productModel}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">单位：</label>
            <div class="col-sm-8">
                <input name="unit" th:field="*{unit}" class="form-control" type="text">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">状态：</label>
            <div class="radio-box" th:each="dict : ${@dict.getType('sys_job_status')}">
                <input type="radio" th:id="${dict.dictCode}" name="visible" th:value="${dict.dictValue}" th:field="*{status}">
                <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">创建时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input name="createTime" th:value="${#dates.format(product.createTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">创建人：</label>
            <div class="col-sm-8">
<!--                <input name="sysCreateUserId" th:field="*{sysCreateUserId}" class="form-control" type="text">-->
                <input name="sysUser.userName" th:value="${user.userName}" readonly class="form-control" type="text">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
    var prefix = ctx + "purchase/product";
    $("#form-product-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-product-edit').serialize());
        }
    }

    $("input[name='createTime']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
</script>
</body>
</html>